********************************************************************************
**************************Replication file for *********************************
**"Not Just Elections: Personality Traits and Ambition for Political Office"****
********************************************************************************

cd "C:\Users\hanhassell4\Dropbox\Academic Scholarship\Political Ambition\Replication Files\Political Behavior (PersonalityAmbition)"

***Table 1***

use "LSReplicationData.dta", clear

sum electedofficeamb , detail
sum judicialamb  , detail
sum federalagencyamb , detail
sum statelocalagencyamb , detail

use "AGESReplicationData.dta", clear

sum Elecamb, detail
sum Judamb, detail
sum Execamb, detail
sum Statamb, detail


use "NSReplicationData.dta", clear

sum elecamb , detail
sum judamb  , detail
sum fedamb , detail
sum statamb , detail


***Table 2***

use "AGESReplicationData.dta", clear

reg Elecamb extra_s agree_s open_s cons_s emotstab_s, robust
reg Judamb extra_s agree_s open_s cons_s emotstab_s, robust
reg Execamb extra_s agree_s open_s cons_s emotstab_s, robust
reg Statamb extra_s agree_s open_s cons_s emotstab_s , robust


***Table 3***
use "LSReplicationData.dta", clear

reg electedofficeamb extra agree open consc emotstab , cluster (lawschool)
reg judicialamb extra agree open consc emotstab , cluster (lawschool)
reg federalagencyamb extra agree open consc emotstab , cluster (lawschool)
reg statelocalagencyamb extra agree open consc emotstab  , cluster (lawschool)


***Table 4***

use "NSReplicationData.dta", clear

reg elecamb extra agree open consc emotstab, robust
reg judamb extra agree open consc emotstab, robust
reg fedamb extra agree open consc emotstab, robust
reg statamb extra agree open consc emotstab, robust

***Table 5***

use "NSReplicationData.dta", clear


alpha Q34_7_1 Q34_7_2 Q34_7_3 Q34_7_4 Q34_7_5 Q34_7_6  Q34_8_1 Q34_8_2 Q34_8_3 Q34_8_4 Q34_8_5 Q34_8_7
*Average interitem covariance:     .159
*Number of items in the scale:           12
*Scale reliability coefficient:      0.8656
**Is there sufficient variation for EFA?  Yes
factortest Q34_7_1 Q34_7_2 Q34_7_3 Q34_7_4 Q34_7_5 Q34_7_6 Q34_8_1 Q34_8_2 Q34_8_3 Q34_8_4 Q34_8_5 Q34_8_7
**EFA
factor Q34_7_1 Q34_7_2 Q34_7_3 Q34_7_4 Q34_7_5 Q34_7_6 Q34_8_1 Q34_8_2 Q34_8_3 Q34_8_4 Q34_8_5 Q34_8_7, pcf
rotate, promax
sortl


***Table 6***

use "NSReplicationData.dta", clear

*Create variables for those factors
*electoral
gen personallife = (Q34_7_3+ Q34_7_4+ Q34_7_5+ Q34_7_6)/4
*publicity
gen electoralcomponents = (Q34_8_1 +Q34_8_3+ Q34_8_4+ Q34_8_5+ Q34_8_7)/5
* Job responsibilities
gen theJob = (Q34_7_1+ Q34_7_2+ Q34_8_2)/3

reg electoralcomponents extra agree open consc emotstab, robust
reg personallife extra agree open consc emotstab, robust
reg theJob extra agree open consc emotstab, robust



***Table 7***

use "LSReplicationData.dta", clear

reg electoralcomp extra agree open consc emotstab  , cluster (lawschool)
reg personalcomp extra agree open consc emotstab , cluster (lawschool)
reg jobcomp extra agree open consc emotstab , cluster (lawschool)



***Table A.1***

use "NSReplicationData.dta", clear

tab gender
sum age
tab educ
sort Q35_14
by Q35_14: tab race
tab PartyID

***Table A.2***

use "LSReplicationData.dta", clear

tab female
tab race
tab latino
tab pid3
tab ideology



***Table A.3***

use "AGESReplicationData.dta", clear

tab genderI
tab age1 if age1>1
tab raceI if raceI >1
tab educ1 if educ1 >1
tab party1 if party1 >1


***Table A.5***

use "AGESReplicationData.dta", clear


reg Statamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust
reg Elecamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust
reg Judamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust
reg Execamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust


***Table A.6***

use "AGESReplicationData.dta", clear

ologit Statamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1,robust
ologit Elecamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1,robust
ologit Judamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust
ologit Execamb open_s cons_s extra_s agree_s emotstab_s i.genderI age ib9.raceI ib5.educ1 party1 ideo if raceI!=1, robust


***Table A.7***
use "AGESReplicationData.dta", clear

mlogit Elecamb extra_s agree_s open_s cons_s emotstab_s, robust baseoutcome(0)
mlogit Statamb extra_s agree_s open_s cons_s emotstab_s, robust baseoutcome(0)
mlogit Judamb extra_s agree_s open_s cons_s emotstab_s, robust baseoutcome(0)
mlogit Execamb extra_s agree_s open_s cons_s emotstab_s, robust baseoutcome(0)


***Table A.8***

use "NSReplicationData.dta", clear

reg statamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
reg elecamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
reg judamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
reg fedamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint ,  robust

***Table A.9***

use "NSReplicationData.dta", clear

ologit elecamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
ologit statamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
ologit judamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint , robust
ologit fedamb open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint ,  robust


***Table A.10***

use "NSReplicationData.dta", clear

mlogit elecamb  extra agree open consc emotstab , robust baseoutcome(1)
mlogit statamb extra agree open consc emotstab , robust baseoutcome(1)
mlogit judamb extra agree open consc emotstab , robust baseoutcome(1)
mlogit fedamb extra agree open consc emotstab , robust baseoutcome(1)

***Table A.11***

use "LSReplicationData.dta", clear

reg statelocalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
reg electedofficeamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
reg judicialamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
reg federalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)



***Table A.12***

use "LSReplicationData.dta", clear

ologit statelocalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
ologit electedofficeamb  open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
ologit judicialamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)
ologit federalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool)


***Table A.13***

use "LSReplicationData.dta", clear

mlogit statelocalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool) baseoutcome(0)
mlogit electedofficeamb  open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool) baseoutcome(0)
mlogit judicialamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool) baseoutcome(0)
mlogit federalagencyamb open consc extra agree emotstab ideo knowledge i.race i.female pid7 private, cluster (lawschool) baseoutcome(0)


***Table A.14***

use "NSReplicationData.dta", clear

tab Q34_8_1 //Privacy
tab Q34_8_3 // Scrutiny
tab Q34_8_7 //Conflict
tab Q34_8_5 // Difficult on family/friends
tab Q34_8_4 //Schedule/Travel

tab Q34_7_4 //Publicity
tab Q34_7_3  //Fundraising
tab Q34_7_5 //Persuasion of others to vote for you
tab Q34_7_6 // Competition

tab Q34_7_1 // Talking about Solutions
tab Q34_8_2 // Important Decisions
tab Q34_7_2 // Meeting new people


***Table A.15***

use "LSReplicationData.dta", clear

tab reasons_7 // Privacy
tab reasons_9 // Public Scrutiny
tab reasons_12 // Conflict
tab reasons_11 // Difficult on Fam/friends
tab reasons_10 // Schedule/Travel

tab reasons_4 // Publicity
tab reasons_3 // Fundraising
tab reasons_5 // Pesuasion of others to vote for you 
tab reasons_6 // Competition

tab reasons_1 // Solutions
tab reasons_8 // Making Important decisions
tab reasons_2 // Meeting people


***Table A.16***

use "NSReplicationData.dta", clear

*Create variables for those factors
*electoral
gen personallife = (Q34_7_3+ Q34_7_4+ Q34_7_5+ Q34_7_6)/4
*publicity
gen electoralcomponents = (Q34_8_1 +Q34_8_3+ Q34_8_4+ Q34_8_5+ Q34_8_7)/5
* Job responsibilities
gen theJob = (Q34_7_1+ Q34_7_2+ Q34_8_2)/3

reg personallife open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint, robust
reg electoralcomponents open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint, robust
reg theJob open consc extra agree emotstab i.gender ideo5 PartyID i.race age educ income polknow polint, robust



***Table A.17***

use "LSReplicationData.dta", clear

reg personalcomp open consc extra agree emotstab ideo i.race i.female pid7 private, cluster (lawschool)
reg electoralcomp open consc extra agree emotstab ideo i.race i.female pid7 private, cluster (lawschool)
reg jobcomp open consc extra agree emotstab ideo i.race i.female pid7 private, cluster (lawschool)


***Figure A.1***

**See R Data Replication**
